const blur_frag =/*wgsl*/`
struct Input {  
    @location(0) uv : vec2<f32>,
};
struct Output {
    @location(0) color:vec4<f32>,
};
fn blur(Sampler:sampler,Texture:texture_2d<f32>,input:Input)->vec4<f32> {
    //计算采样点
    let sps0:vec2<f32>=input.uv+vec2<f32>(-1.0, -1.0)/resolution;
    let sps1:vec2<f32>=input.uv+vec2<f32>(0.0, -1.0)/resolution;
    let sps2:vec2<f32>=input.uv+vec2<f32>(1.0, -1.0)/resolution;

    let sps3:vec2<f32>=input.uv+vec2<f32>(-1.0, 0.0)/resolution;
    let sps4:vec2<f32>=input.uv;
    let sps5:vec2<f32>=input.uv+vec2<f32>(1.0, 0.0)/resolution;

    let sps6:vec2<f32>=input.uv+vec2<f32>(-1.0, 1.0)/resolution;
    let sps7:vec2<f32>=input.uv+vec2<f32>(0.0, 1.0)/resolution;
    let sps8:vec2<f32>=input.uv+vec2<f32>(1.0, 1.0)/resolution;
    var color:vec4<f32>=textureSample(Texture, Sampler,sps0)+
    textureSample(Texture, Sampler,sps1)+
    textureSample(Texture, Sampler,sps2)+
    textureSample(Texture, Sampler,sps3)+
    textureSample(Texture, Sampler,sps4)+
    textureSample(Texture, Sampler,sps5)+
    textureSample(Texture, Sampler,sps6)+
    textureSample(Texture, Sampler,sps7)+
    textureSample(Texture, Sampler,sps8);
    return color/9.0*(1.0-blurIntensity)+vec4<f32>(blurColor,1.0)*blurIntensity;
}
@group(0) @binding(0) var<uniform> resolution : vec2<f32>;
@group(0) @binding(1) var Sampler: sampler;
@group(0) @binding(2) var Texture: texture_2d<f32>;
@group(0) @binding(3) var <uniform> blurColor : vec3<f32>;
@group(0) @binding(4) var <uniform> blurIntensity : f32;
@fragment
fn main(input:Input) -> Output {
    var output:Output;
    var color=blur(Sampler,Texture, input);
    output.color=color;
    return output;
}
`
export {blur_frag}